import SessionUtil from "@/lib/SessionUtil";
import {getButtonPermissions} from "@/api/permissionApi";
let permissionService = {
    getButtonPermissions: function () {
        let buttonPermissions = SessionUtil.getItem("ButtonPermissions")
        if (buttonPermissions == null) {
            return new Promise(resolve => {
                getButtonPermissions({systemCode: 'share'}).then(res=>{
                    SessionUtil.setItem("ButtonPermissions", res);
                    resolve(res)
                });
            })
        }
        return Promise.resolve(buttonPermissions);
    }
}
export default permissionService;
